home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 564 < prev    next >
Text File  |  1996-08-06  |  2KB  |  37 lines

  1. Newsgroups: comp.std.c
  2. Path: in2.uu.net!bast!wattres!steve
  3. From: steve@Watt.COM (Steve Watt -- KD6GGD)
  4. Subject: Re: Prefixing functions with return type..
  5. References: <4hstf8$jf3@cybernews.cyberus.ca>
  6. Organization: Watt Consultants,   San Jose, CA, USA
  7. Message-ID: <1996Mar14.080731.15076@Watt.COM>
  8. Date: Thu, 14 Mar 96 08:07:31 GMT
  9.  
  10. In article <4hstf8$jf3@cybernews.cyberus.ca> robert_mohid@cyberus.ca (Robert Mohid) writes:
  11. >I've been recently told that the practice of prefixing functions to
  12. >indicate return type (ie: int iGetInt(void)   ) is "part of a new
  13. >approach in progrmming". Can anyone confirm/deny this? I am extremely
  14. >skeptical about that last statement, and to any who would reply
  15. >*please* include some references as to make your claims as irrefutable
  16. >as possible.    Thanks in advance.
  17.  
  18. Well, it's a slightly newish thing.  Microsoft decided to use it(*) in
  19. their Windows code.  Many (many many!) people think it makes the names
  20. much harder to read -- if I wanted to look at names with lots of type
  21. information in them, I'd look at the output of a C++ translator.
  22.  
  23. Allen Holub has a wonderful bit on Hungarian notation in his book "Enough
  24. Rope to Shoot Yourself in the Foot" (ISBN 0-07-029689-8), rule number 44.1.
  25. The basic part of the rule is "Do not clutter names with gibberish."  The
  26. details of the rule expand the definition of gibberish to include leading
  27. weird type stuff, as well as starting pointer names with p.
  28.  
  29. (*)it == Hungarian Notation, after the native country of Microsoft's
  30. head of programming, Charles Simonyi, who invented it.  Holub also
  31. explains why it is useful in one particular (assembly language) context.
  32. -- 
  33. Steve Watt KD6GGD  PP-ASEL              Packet: KD6GGD @ N0ARY.#NOCAL.CA.USA.NA
  34. ICBM: 121W 56' 53.1" / 37N 20' 16.7"      Internet: Home: {root,steve}@Watt.COM
  35. "I am always ready to learn, although I don't always like being taught."
  36.                                                          -- Winston Churchill
  37.